const app = getApp();
const util=require('../../utils/util.js');
Page({
  data: {
    shopInfo: {}
  },
  onLoad(options) {
    let that = this;
    // 获取商户信息
    let id = options.id;
    util.httpRequest('/getShopInfo', {
      longitude: app.globalData.longitude,
      latitude: app.globalData.latitude,
      id: id
    }, function(res) {
      if (res.code == 1) {
        that.setData({
          shopInfo:res.data
        })
      }
    })
  },

  openLocation(){
    let that=this;
    my.openLocation({
        latitude: Number(that.data.shopInfo.lat),
        longitude: Number(that.data.shopInfo.lng),
        name:that.data.shopInfo.name,
        address:that.data.shopInfo.address
    });
  }
});
